package com.example.mybatislearn.dao.mappper;

import com.example.mybatislearn.domain.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UserMapper {
    @Select({
            "<script>",
            "select",
            "*",
            "from ${tableName}",
            "<where> <if test=\"uid != null\">uid = #{uid,javaType = String ,jdbcType=VARCHAR}</if></where>",
            "order by `uname`asc",
            "</script>"
    })
    List<User> selectList(@Param("tableName")String tableName, @Param("uid") String uid);
}
